//
//  TPArticleDetailHeader.m
//  Yimei
//
//  Created by xiaowu xiaowu on 2017/10/30.
//  Copyright © 2017年 xiaowu xiaowu. All rights reserved.
//

#import "TPArticleDetailHeader.h"

@implementation TPArticleDetailHeader

-(instancetype)initWithFrame:(CGRect)frame{
    
    if(self = [super initWithFrame:frame]){
        
        [self setup];
    }
    return self;
}
-(void)setup{
    
    self.backgroundColor = [UIColor whiteColor];
    self.title_label.backgroundColor = TP_COLOR_240;
    [self.title_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.mas_equalTo(0.0);
        make.height.mas_equalTo(10.0);
    }];
    
    [self.titleButton setBackgroundImage:ImageNamed(@"TP_detail_title_bg") forState:UIControlStateNormal];
    [self.titleButton setTitle:@"评论" forState:0];
    [self.titleButton setTitleEdgeInsets:UIEdgeInsetsMake(5.0, 0, 0, 0)];
    self.titleButton.contentMode = UIViewContentModeScaleAspectFit;
    [self.titleButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(90, 38.0));
        make.top.mas_equalTo(self.title_label.mas_bottom).offset(8.0);
        make.centerX.mas_equalTo(self.mas_centerX);
    }];
    
    
    
}
@end
